<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Product exhibition - Beijing Huateng rubber and plastic latex products Co., Ltd</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/all.min.css">
    <link rel="stylesheet" href="css/style.css">
</head>

#set(cid=C.get('cid'))
#set(categoryid=C.get('categoryid'))

<body>
    <div class="flex-container prdlist">
        #include('inc/top_en.html')
        <div class="container-fluid">
            <div class="intobg"></div>
        </div>

        <div class="container text-center pb-2">
            <h2 class="product-title" style="margin-top: 20px;margin-bottom: 12px;">Rubber gloves</h2>
            <!--<p class="product-subtitle">胶皮手套</p>-->
        </div>
        <div class="container-fluid eq-bg">
            <div class="container pt-4 mb-5">
                <div class="row">
                    <div class="col-3">
                        #if(categoryid)
                        <ul class="menu">
                            <li #if(!C.get('cid')) class="active" #end>
                                <i class="fas fa-arrow-circle-right"></i><a href="/productlisten?categoryid=#(categoryid)">ALL</a>
                            </li>
                            #productCategoryList(parentId=categoryid)
                            #for(p : categories)
                            <li #if(p.id.toString()==C.get('cid')) class="active" #end><!--class="active"-->
                                <i class="fas fa-arrow-circle-right"></i><a href="/productlisten?categoryid=#(categoryid)&cid=#(p.id)">#(p.title ??)</a>
                            </li>
                            #end
                            #end
                        </ul>
                        #end
                    </div>
                    #productPage(categoryId=caid,page=page)
                    <div class="col-9">
                        <ul class="page" id="app">
                            #--#if(cid)
                                #set(caid = cid)
                            #else
                                #set(caid = categoryid)
                            #end
                            #for(product:productPage.list)
                                <li>
                                    <a href="/productdetailsen?productid=#(product.id)">
                                        <img src="#(product.thumbnail ??)" alt="">
                                        #(product.title ??)
                                    </a>
                                </li>
                            #end--#
                            
                            <li v-for="entry in list">
                                <a :href="'/productdetailsen?productid='+entry.id">
                                    <img :src="entry.thumbnail" alt="">
                                    {{ entry.title }}
                                </a>
                            </li>
                            
                        </ul>
                        
                        <div class="text-center mt-4">
                            <a href="javascript:next();" class="btn btn-outline-primary">Load more&nbsp;&nbsp;<i class="fas fa-plus-square"></i></a>
                        </div>
                        
                    </div>
                    #end
                </div>
                <div class="row prdad">
                    <div class="col-12">
                        <a href="#"><img src="images/prd-ad.jpg" alt=""></a>
                    </div>
                </div>
                <div class="row logo mt-5 mb-5 text-center align-items-center justify-content-md-center">
                    <div class="col-2"><img src="images/brand_xuelian.png"></div>
                    <div class="col-2"><img src="images/brand_beiru.png"></div>
                    <div class="col-2"><img src="images/brand_ruijing.png"></div>
                    <div class="col-2"><img src="images/brand_beirui.png"></div>
                    <div class="col-2"><img src="images/brand_jingyu.png"></div>
                    <div class="col-2"><img src="images/brand_yigang.png"></div>
                </div>
            </div>
        </div>
    </div>
    <!--bottom-->
    #include('inc/footer_en.html')

    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
        
        var page = 1;
        var pageMax;
        
        var app = new Vue({
          el: '#app',
          data: {
              list:[]
          }
        });
        
        function next(){
            page++;
            getdata(page);
        }
        
        function getdata(p){
            var url = "/productapi";
            pm = {
                page:p,
                pageSize:12,
                categoryid:#if(cid) #(cid)#else #(categoryid)#end
            }
            
            if(pageMax!="" && page > pageMax){
                alert("No more data!")
                return;
            }
            
            $.post(url,pm,function(e){
                
                pageMax = e.totalPage;
                
                for(var i in e.list){
                    app.list.push(e.list[i]);
                }
                
            });
        }
        
        getdata(1);
    </script>
</body>

</html>